package org.example.studentsdemo.teachers.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.example.studentsdemo.teachers.DTO.addStudentsToTeacherDTO;
import org.example.studentsdemo.teachers.entity.teachers;
import org.example.studentsdemo.utils.HttpResult;
import org.springframework.http.ResponseEntity;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;


public interface teachersService {

    boolean saveBatch(Collection<teachers> entityList, int batchSize);

    boolean saveOrUpdateBatch(Collection<teachers> entityList, int batchSize);

    boolean updateBatchById(Collection<teachers> entityList, int batchSize);

    boolean saveOrUpdate(teachers entity);

    teachers getOne(Wrapper<teachers> queryWrapper, boolean throwEx);

    Optional<teachers> getOneOpt(Wrapper<teachers> queryWrapper, boolean throwEx);

    Map<String, Object> getMap(Wrapper<teachers> queryWrapper);

    <V> V getObj(Wrapper<teachers> queryWrapper, Function<? super Object, V> mapper);

    BaseMapper<teachers> getBaseMapper();

    Class<teachers> getEntityClass();

    ResponseEntity<HttpResult<List<teachers>>>  getTeacherList();

    ResponseEntity<HttpResult<teachers>> addTeacher(teachers teachers);

    ResponseEntity<HttpResult<teachers>> updateTeacher(teachers teachers);

    ResponseEntity<HttpResult<Boolean>> deleteTeacher(Long id);


    ResponseEntity<HttpResult<teachers>> getTeacherById(Long id);

    ResponseEntity<HttpResult<Boolean>> addStudentsToTeacherDTO(addStudentsToTeacherDTO addStudentsToTeacherDTO);
}
